package Xiaofang.Homework;
import java.io.*;

public class Work2 {
    public static void main(String[] args) {
        String num2=null;
        try {
            InputStreamReader is=new InputStreamReader(new FileInputStream("D:\\Xiaofang\\data.txt"));
            BufferedReader br=new BufferedReader(is);
            try {
                String num1=br.readLine();
                int zhi1= Integer.parseInt(num1);
                while ((num2=br.readLine())!=null){
                    int zhi2= Integer.parseInt(num2);
                    if(zhi2>zhi1){
                        zhi1=zhi2;
                    }
                }
                System.out.println("最大值："+zhi1);
            } catch (IOException e) {
                e.printStackTrace();
            }finally {
                try {
                    br.close();
                    is.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
